-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for exception on hanging doublequote #222
Fix for exception on hanging doublequote #222
Conversation
@andreasabel @phadej Any updates on this simple fix for a nasty bug (caused by use of partial function |
Test case `escapedMalformed0` is failing, throwing uncaught `error`
8feec3e
to
a4627a6
Compare
47d7eb5
to
c7bdbca
Compare
Tests are failing, e.g. https://github.com/haskell-hvr/cassava/actions/runs/7400077740/job/20151432820?pr=222#step:20:84
Building the tests also fails, e.g. https://github.com/haskell-hvr/cassava/actions/runs/7400077740/job/20151434424?pr=222#step:19:34
|
Squashed from commits: - task: add test cases for decoding escaped input Test case `escapedMalformed0` is failing, throwing uncaught `error` - fix: handle case when input for field parser is a single opening double-quote - Fix output of escapedMalformed1 test (this contribution got deleted) - Fixup PR #222: remove failing test, drop testing for GHC < 8.4 Co-authored-by: German Zhyvotnikov <german.zhyvotnikov@zoominsoftware.com>
Fixup of this PR in |
## Version 0.5.3.2 * Proper exception on hanging doublequote ([PR #222](haskell-hvr/cassava#222)). * Allow latest `hashable`. * Build tested with GHC 8.0 - 9.10.1. * Functionality tested with GHC 8.4 - 9.10.1.
Hi,
There's a problem with escaped fields parser, -- it is partial on opening double quote. Means, it throws Haskell
error
instead of properly failing. The problem is because of ByteString.init being called on possibly empty bytestring (w/o checking). This small PR suggest a fix for this, plus adds some tests for decoding of escaped input.